@model LanLordz.Models.EditTournamentModel
@{
    ViewBag.Title = "Edit Tournament";
}
    <h2>@ViewBag.Title</h2>
    @using (Html.BeginForm())
    {
     @Html.AntiForgeryToken()
     @Html.ValidationSummary("There was an error saving the tournament:", new { @class = "ErrorText" })
     <table>
      <tr><td>Title:</td><td>@Html.TextBox("Title", Model.Tournament.Title)</td></tr>
      <tr><td>Game:</td><td>@Html.TextBox("Game", Model.Tournament.Game)</td></tr>
      <tr><td>Team Size:</td><td>@Html.TextBox("TeamSize", Model.Tournament.TeamSize)</td></tr>
      <tr><td>Score Mode:</td><td>@Html.DropDownList("ScoreMode", from s in Model.ScoreModes
                                                                  select new SelectListItem
                                                                  {
                                                                      Text = s.Value,
                                                                      Value = s.Key,
                                                                      Selected = (Model.Tournament.ScoreMode == s.Key)
                                                                  })</td></tr>
      <tr><td>Type:</td><td>@Html.DropDownList("PairingsGenerator", from p in Model.PairingsGenerators
                                                                    select new SelectListItem
                                                                    {
                                                                        Text = p,
                                                                        Value = p,
                                                                        Selected = (Model.Tournament.PairingsGenerator == p)
                                                                    })</td></tr>
      <tr><td>Tournament Director:</td><td>@Html.TextBox("TDUsername", Model.TDUsername)</td></tr>
      <tr><td>Game Info:</td><td>@Html.TextArea("GameInfo", Model.Tournament.GameInfo)</td></tr>
      <tr><td>Server Settings:</td><td>@Html.TextArea("ServerSettings", Model.Tournament.ServerSettings)</td></tr>
      <tr><td></td><td><input type="submit" value="Save" /></td></tr>
     </table>
    }
